﻿using NSBus.Dto.Commands;
using NServiceBus;
using Sanelib.Services;

namespace NSBus.Server.CommandHandlers
{
    public class SendSmsHandler : IHandleMessages<SendSmsCommand>
    {
        private readonly ISmsSender _smsSender;

        public SendSmsHandler(ISmsSender smsSender)
        {
            _smsSender = smsSender;
        }

        public void Handle(SendSmsCommand sendSmsCommand)
        {
            _smsSender.SendShortMessage(sendSmsCommand.MessageBody, sendSmsCommand.MobileNumber);
        }
    }
}